missing import inside blkif. Fix the command parsing for op_device_destroy and
op_device_configure -- the device IDs should be strings, to allow the user to
specify devices by name as well as number.
This is the second half to the fixes for bug #315.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
except Exception, exn:
log.exception("Request %s failed.", op)
if req.useSxp():
- return ['xend.err', "Exception: " + str(exn)]
+ return ['xend.err', str(exn)]
else:
return "<p>%s</p>" % str(exn)
def op_device_destroy(self, op, req):
return self.call(self.dom.destroyDevice,
[['type', 'str'],
- ['dev', 'int']],
+ ['dev', 'str']],
req)
def op_device_configure(self, op, req):
return self.call(self.dom.device_configure,
[['config', 'sxpr'],
- ['dev', 'int']],
+ ['dev', 'str']],
req)
from xen.util import blkif
from xen.xend import sxp
+from xen.xend.XendError import VmError
from xen.xend.server.DevController import DevController
if error == "Not found" and dom != None:
err("Domain '%s' not found when running 'xm %s'" % (dom, cmd))
sys.exit(1)
- elif error == "Exception: Device not connected":
- err("Device not connected")
- sys.exit(1)
else:
- raise ex
+ err(error)
+ sys.exit(1)
#########################################################################